﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PubSubLite.Configuration
{
    /// <summary>
    /// Provides methods for configuration
    /// </summary>
    public interface IBusConfigurationSetup
    {
        /// <summary>
        /// Register a logger implementing the
        /// <see cref="IBusLogger"/> interface
        /// </summary>
        /// <param name="logger">The logger to register</param>
        /// <returns>The current configuration</returns>
        IBusConfigurationSetup RegisterLogger(IBusLogger logger);
        /// <summary>
        /// If true exceptions will be rethrown after logging.
        /// </summary>
        /// <param name="rethrow"></param>
        /// <returns>The current configuration</returns>
        IBusConfigurationSetup SetRethrowExceptions(bool rethrow);
        /// <summary>
        /// Sets log level for the bus
        /// </summary>
        /// <param name="level"></param>
        /// <returns>The current configuration</returns>
        IBusConfigurationSetup SetLogLevel(BusLogLevel level);
        /// <summary>
        /// If true debug info from the bus will be logged
        /// </summary>
        /// <param name="logDebugInfo"></param>
        /// <returns>The current configuration</returns>
        IBusConfigurationSetup SetLogDebugInfo(bool logDebugInfo);
        /// <summary>
        /// Sets the thread setting for the bus. If ThreadSettings.SingleThread
        /// all calls from the bus will execute in the current thread.
        /// If ThreadSettings.MessageHandlingInSeparateThreads 
        /// all calls from the bus will execute in separate threads using a thread pool.
        /// </summary>
        /// <param name="setting"></param>
        /// <returns>The current configuration</returns>
        IBusConfigurationSetup SetThreadSetting(ThreadSettings setting);
    }
}
